<template>
	<view class="box">
		<view class="header">
			<image src="../../../static/img/headFeature/follow/followTitle.png"></image>
			<view class="information">
				<view class="top">
					<view>会员：{{details.memberNmae}}</view>
					<view>年龄：{{details.age}}岁</view>
					<view>性别：{{details.sex}}</view>
				</view>
				<view class="bottom">
					<view>签发人：{{details.healthName}}</view>
					<view>签发日期：{{details.floowDate}}</view>
				</view>
				<view class="content">
					<view>随访日期：{{details.floowDate}}</view>
					<view>随访方式：{{details.followUpMethod}}</view>
				</view>
			</view>
		</view>
		<view class="two"></view>
		<view class="three"></view>
		
		<view class="mainContent">
			<!-- 症状 -->
			<view class="symptom">
				<view class="boxOne">
					<image src="../../../static/img/headFeature/follow/followTitle1@2x.png"></image>
				</view>
				<view class="symptomDescribe"> 
					<view class="symptomContent" v-if="details.symptom && details.symptom.length > 0" v-for="(item,index) in details.symptom" :key="index">{{(Number(item.name)+1)+'. ' + item.value}}</view>
					<view class="symptomContent on"  v-if="details.symptom && details.symptom.length <= 0">无症状</view>
				</view>
			</view>
			
			<!-- 体征 -->
			<view class="symptom">
				<view class="boxOne">
					<image src="../../../static/img/headFeature/follow/followTitle2@2x.png" style="width: 432upx;height: 33upx;"></image>
				</view>
				<view class="signDescribe">
					<view class="xq" v-for="(item,index) in details.physicalSign" :key="index">
						<view v-if="index != 2">
							<span class="name">{{item.name}}</span>
							<em>：</em>
							<span class="currentContent">{{item.value || '未填写'}}</span>
						</view>
						<view v-else>
							<span class="name">{{item.name}}</span>
							<em>：</em>
							<span class="xy"><i class="one">{{item.value.split(',')[0] || '未填写'}}</i> <em v-if="item.value.split(',')[1]">/</em> <i class="second">{{item.value.split(',')[1] || ''}}</i></span>
						</view>
					</view>
				</view>			
			</view>
			
			<!-- 生活方式指导 -->
			<view class="symptom">
				<view class="boxOne">
					<image src="../../../static/img/quickly/follow/followTitle3@2x.png" style="width: 484upx;"></image>
				</view>
				<view class="signDescribe">
					<view class="live">
						<view class="left">
							<view>吸烟</view>
							<em>：</em>
						</view>
						<view class="right">{{details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.smoke || ''}}</view>
					</view>	
					<view class="live">
						<view class="left">
							<view>喝酒</view>
							<em>：</em>
						</view>
						<view class="right">{{details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.drink || ''}}</view>
					</view>
					<view class="live">
						<view class="left">
							<view>运动</view>
							<em>：</em>
						</view>
						<view class="right" v-if="details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.sport == '不运动'">不运动</view>
						<view class="right" v-else>
							<view class="firstYd">{{details.appLifeGuidanceEntity && JSON.parse(details.appLifeGuidanceEntity.sport).motion}}次/周</view>
							<span v-if="details.appLifeGuidanceEntity && JSON.parse(details.appLifeGuidanceEntity.sport).duration">/</span>
							<view class="secondYd">{{details.appLifeGuidanceEntity && JSON.parse(details.appLifeGuidanceEntity.sport).duration}}分钟/次</view>
						</view>
					</view>	
					<view class="live">
						<view class="left">
							<view>摄盐情况</view>
							<em>：</em>
						</view>
						<view class="right">{{details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.saltUptake}}</view>
					</view>
					<view class="live">
						<view class="left">
							<view>心里调整</view>
							<em>：</em>
						</view>
						<view class="right">{{details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.psychology}}</view>
					</view>
					<view class="live">
						<view class="left">
							<view>遵从行为</view>
							<em>：</em>
						</view>
						<view class="right">{{details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.complianceBehavior}}</view>
					</view>
					<view class="live">
						<view class="left">
							<view>其他</view>
							<em>：</em>
						</view>
						<view class="right" v-if="details.appLifeGuidanceEntity && details.appLifeGuidanceEntity.other" v-html="details.appLifeGuidanceEntity.other"></view>
					</view>
					
				</view>	
			</view>
			
			<!-- 其他事项-->
			<view class="symptom">
				<view class="boxOne">
					<image src="../../../static/img/headFeature/follow/followTitle4@2x.png"></image>
				</view>
				<view class="symptomDescribe">                   
					<view class="symptomContent" v-if="details.moreMethood" v-for="(item,index) in details.moreMethood" :key="index">{{(Number(item.name)+1)+'. '+item.value}}</view>
					<view class="symptomContent on" v-if="details.moreMethood && details.moreMethood.length <= 0">无其他事项</view>
				</view>
			</view>
			
			<!-- 服务情况-->
			<view class="symptom">
				<view class="boxOne">
					<image src="../../../static/img/headFeature/follow/followTitle5@2x.png"></image>
				</view>
				<view class="symptomDescribe">                   
					<view class="distinguish">
						<view class="left">下次随访日期：</view>
						<view class="right">{{details.nextDate}}</view>
					</view>
					<view class="distinguish">
						<view class="left">本次随访人员：</view>
						<view class="right">{{details.healthName}}</view>
					</view>
					<view class="distinguish">
						<view class="left">本次随访会员：</view>
						<view class="right">{{details.memberNmae}}</view>
					</view>
					<view class="distinguish">
						<view class="left">此次随访评价：</view>
						<view class="right">{{details.evaluate}}</view>
						<!-- <view class="right" v-if="details.evaluate == '未评价'">
							<input type="text" placeholder="请评价" @click="show = true" disabled="true" v-model="evaluate">
						</view> -->
					</view>
				</view>
			</view>
		</view>
		
		<!-- <view class="sendComments" @click="sendComments" v-if="details.evaluate == '未评价'">签名并评价</view>
		<u-select v-model="show" @confirm="confirm" :list="evaluateArr"></u-select> -->
	</view>
</template>

<script>
	import {getUrlParam} from '@/static/js/filter.js';
	export default {
		data() {
			return {
				show: false,
				details: {},
				evaluateArr: [
					{
						value: "1",
						label: "满意"
					},
					{
						value: "2",
						label: "不满意"
					},
					{
						value: "3",
						label: "不评价"
					}
				],
				evaluate: '',
				id: ''
			}
		},
		onLoad() {
			this.id = getUrlParam('id');
			if(this.id) {
				this.$api.detaileFollowUpRecords(this.id).then((res) => {
					this.details = res.data.result;
				})
			}
		},
		methods: {
			confirm(e) {
				this.evaluate = e[0].label;
			},
			sendComments() {		
				this.$api.AppMedicalRecordsUpdateByEvaluate({evaluate:this.evaluate,id:Number(this.id)}).then((res) => {
					if(res.data.returnCode == 200) {
						uni.showToast({
							title: '评价成功',
							icon: 'none'
						})
						setTimeout(() => {
							uni.navigateBack({
								delta:1
							})
						},1000)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750upx;
		min-height: calc(100vh - 44px);
		background-color: #F8F8F8;
		padding: 26upx 0 88upx;
		.header {
			background: url(../../../static/img/quickly/information/bj3@2x.png) no-repeat;
			background-size: 100% 100%;
			width: 702upx;
			padding-bottom: 30upx;
			margin: 0 24upx;	
			z-index: 10;
			image {
				width: 622upx;
				height: 48upx;
				margin: 0 auto 44upx;
				display: block;
				padding-top: 27upx;
			}
			.information {
				width: 100%;
				padding: 0 42upx;
				box-sizing: border-box;
				.top,.bottom {
					display: flex;
					align-items: center;
					justify-content: space-around;
					view {
						color: #FFFFFF;
						font-weight: 30upx;
						margin-right: 25upx;
					}
					view:last-child {
						margin-right: 0;
					}
				}
				.bottom {
					margin-top: 20upx;
				}
				.content {
					color: #FFFFFF;
					font-weight: 30upx;
					margin-right: 25upx;
					margin-left: 20upx;
					view {
						margin-top: 20upx;
					}
				}
			}
		}
		.two {
			background: url(../../../static/img/quickly/information/bj2@2x.png) no-repeat;
			background-size: 100% 100%;
			width: 602upx;
			height: 254upx;
			margin: -222upx auto 0;
		}
		.three {
			background: url(../../../static/img/quickly/information/bj1@2x.png) no-repeat;
			background-size: 100% 100%;
			width: 508upx;
			height: 254upx;
			margin: -226upx auto 0;
		}
		
		.mainContent {
			width: 702upx;
			margin: 0 24upx;
			.symptom {
				margin-top: 56upx;
				.boxOne {
					width: 702upx;
					background: #38CB97;
					border-radius: 24upx;
					padding: 18upx 0 40upx;
					image {
						width: 424upx;
						height: 38upx;
						margin: 0 auto;
						display: block;
					}
				}
				.symptomDescribe,
				.signDescribe{
					margin-top: -26upx;
					width: 702upx;
					background: #FFFFFF;
					border-radius: 24upx;
					padding: 50upx 35upx;
					box-sizing: border-box;
				}
				.symptomDescribe .on {
					text-align: center;
				}
				.signDescribe .xq {
					view {
						display: flex;
						align-items: center;
						color: #333333;
						font-size: 30upx;
						line-height: 64upx;
						.name {
							width: 240upx;
						}
						em,i {
							font-style: normal;
						}
						.currentContent {
							flex: 1;
						}
						.xy {
							flex: 1;
							display: flex;
							.one {
								width: 120upx;
							}
							.second {
								flex: 1;
								text-align: center;
							}
						}
					}
				}
				.live {
					line-height: 64upx;
					display: flex;
					.left {				
						display: flex;
						view {	
							width: 130upx;
							text-align: justify;
							text-align-last: justify;
						}
						em {
							font-style: normal;
						}
					}
					.right {
						flex: 1;
						margin-left: 16upx;
						display: flex;
						.firstYd {
							width: 180upx;
						}
						.secondYd {
							flex: 1;
							text-align: center;
						}
					}
				}
				.distinguish {
					display: flex;
					line-height: 64upx;
					.left {
						width:240upx;
					}
					.right {
						input {
							width: 242upx;
							height: 52upx;
							line-height: 52upx;
							background: #F8F8F8;
							border: 1upx solid #D4D4D4;
							border-radius: 6upx;
							padding: 0 6upx;
							margin-left: -10upx;
							color: #333333;
							font-size: 30upx;
						}
					}
				}
			}
		}
		.sendComments {
			margin: 116upx auto 0;
			width: 611upx;
			height: 70upx;
			background: #38CB97;
			border-radius: 35upx;
			color: #FFFFFF;
			font-size: 30upx;
			line-height: 70upx;
			text-align: center;
		}
	}
</style>
